﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;

namespace IniTechCaash.Domain.Entities
{
    /// <summary>
    /// A record of financial transactions. 
    /// </summary>
    public class Account : AuditableEntity
    {
        /// <summary>
        /// The balance of this <see cref="Account"/>. 
        /// </summary>
        [Required]
        public decimal Balance { get; set;}

        /// <summary>
        /// A user-specified description
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// The <see cref="Descriptive"/> for <see cref="Account"/> is "ACT".
        /// </summary>
        public override string Descriptive
        {
            get { return "ACT"; }
        }

        /// <summary>
        /// Gets or sets whether this <see cref="Account"/> is enabled for all types of use. 
        /// </summary>
        [Required]
        public bool IsEnabled { get; set; }

        /// <summary>
        /// The list of <see cref="JournalEntryLine"/>s associated with this <see cref="Account"/>. 
        /// </summary>
        public virtual IList<JournalEntryLine> JournalEntryLines { get; set; }

        /// <summary>
        /// Name of this <see cref="Account"/>. 
        /// </summary>
        [Required]
        [StringLength(256)]
        public string Name { get; set; }

        /// <summary>
        /// 9-digit account number.
        /// </summary>
        [Required]
        [StringLength(9)]
        public string Number { get; set; }

        /// <summary>
        /// The <see cref="AccountType"/>. 
        /// </summary>
        [Required]
        public AccountType Type { get; set; }
    }
}
